package com.drug.mingkang.service.impl;
import com.drug.mingkang.mapper.HqRawmaterialMapper;
import com.drug.mingkang.model.Material;
import com.drug.mingkang.service.HqRawmaterialService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * (Material)表服务实现类
 *
 * @author ll
 * @since 2020-08-06 20:30:26
 */
@Service("materialService")
public class HqRawmaterialServiceImpl implements HqRawmaterialService {
    @Resource
    private HqRawmaterialMapper hqRawmaterialMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param materialId 主键
     * @return 实例对象
     */
    @Override
    public Material queryById(String materialId) {
        return this.hqRawmaterialMapper.queryById(materialId);
    }

    @Override
    public List<Material> queryAllByLimit(Material material) {
        return this.hqRawmaterialMapper.queryAllByLimit(material);
    }

    /**
     * 查询行数
     *
     * @author liudan
     * @param material 材料类
     * @return 返回行数
     */
    @Override
    public int selectCount(Material material) {
        return this.hqRawmaterialMapper.selectCount(material);
    }

    @Override
    public List<Material> selectDlt(String typeId) {
        return this.hqRawmaterialMapper.selectDlt(typeId);
    }

    /**
     * 新增数据
     *
     * @param material 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(Material material) {
        int rows=  this.hqRawmaterialMapper.insert(material);
        return rows;
    }

    /**
     * 修改数据
     *
     * @param material 实例对象
     * @return 实例对象
     */
    @Override
    public int update(Material material) {
        int rows =  this.hqRawmaterialMapper.update(material);
        return rows;
    }

    /**
     * 通过主键删除数据
     *
     * @param materialId 主键
     * @return 是否成功
     */
    @Override
    public int deleteById(String materialId) {
        int rwos = hqRawmaterialMapper.deleteById(materialId);
        return rwos;
    }

}